package com.study.guide.codec.Marshalling;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

public class TimeServerInitializer extends ChannelInitializer<SocketChannel> {

	@Override
	protected void initChannel(SocketChannel ch) throws Exception {
		ChannelPipeline pl = ch.pipeline(); //连接所有处理器
		pl
		// 添加Jboss的序列化，编解码工具
		.addLast( MarshallingCodeCFactory.buildMarshallingDecoder() )
		.addLast( MarshallingCodeCFactory.buildMarshallingEncoder() )
		.addLast(new TimeServerHandler());
	}

}
